<%@page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="user" class="model.User" scope="session"></jsp:useBean>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Air Transport - Add New Flight</title>

	<link rel="stylesheet" type="text/css" media="all" href="skins/aqua/theme.css" title="Aqua" />

	<!-- import the calendar script -->
	<script type="text/javascript" src="calendar.js"></script>

	<!-- import the language module -->
	<script type="text/javascript" src="lang/calendar-en.js"></script>

	<!-- helper script that uses the calendar -->
	<script type="text/javascript" src="helper.js"></script>

</head>
<body>
<c:if test="${not user.accessed}">
<c:redirect url="index.html"></c:redirect>
</c:if>

<c:if test="${not user.loggedIn}">
<c:redirect url="index.html"></c:redirect>
</c:if>


<h2><u>Air Transport Service - Add New Flight</u></h2>

<jsp:include page="header.jsp"></jsp:include>


<form name="forma" method="post" action="newflight.html">

<table BORDER="2" cellspacing="2">

<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">Flight ID:</td>
<td align="center">
<input id="flightID" name="flightID" size="25"  TYPE="TEXT" style="float:left">
</td>
</tr>
<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">Departure Time:</td>
<td>
<input id="depTime" name="depTime" size="20"  type="text"
><input type="button" value="..." 
onclick="return showCalendar('depTime', '%d.%m.%Y. %H:%M', '24', true);">

<!--<form action="#">
<input type="text" name="date1" id="depTime" size="20"
><input type="button" value=" ... "
onclick="return showCalendar('depTime', '%d.%m.%Y. %H:%M', '24', true);">
</form>-->
</td>
</tr>
<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">Arrival Time:</td>
<td>
<input type="text" name="arrTime" id="arrTime" size="20"
><input type="button" value="..."
onclick="return showCalendar('arrTime', '%d.%m.%Y. %H:%M', '24', true);">
</td>
</tr>
<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">Source:</td>
<td bgcolor="#dfdfdf">
	<P align="left">
		<SELECT NAME="srcCity" ID="srcCity">
			<c:forEach var="city" items="${cities}">
				<OPTION VALUE="${city.id}">${city.name}</OPTION>
			</c:forEach>
		</SELECT>
</td>
</tr>
<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">Destination:</td>
<td bgcolor="#dfdfdf">
	<P align="left">
		<SELECT NAME="destCity" ID="destCity">
			<c:forEach var="city" items="${cities}">
				<OPTION VALUE="${city.id}">${city.name}</OPTION>
			</c:forEach>
		</SELECT>
</td>
</tr>

<tr>
<td style="BACKGROUND-COLOR: #a8da8f;">Max Seats Count:</td>
<td align="center">
<input id="maxSeatsCount" name="maxSeatsCount" size="25"  TYPE="TEXT" style="float:left"></td>
</tr>

<tr align="center">
<td bgcolor="#CCCCCC">&nbsp;</td>
<td bgcolor="#CCCC99">
  <INPUT TYPE="submit" NAME="submit" VALUE="Add"></td>
</tr>
</table>

</form>


<hr width="30%" align="left">
<c:if test="${not empty flightid}">
	<c:choose>
		<c:when test="${flag}">
			The flight <font color="red"><i><b>${flightid}</b></i></font> is added.
		</c:when>
		<c:otherwise>
			The flight <font color="red"><i><b>${flightid}</b></i></font> is not added.
		</c:otherwise>
	</c:choose>
	<hr width="30%" align="left">
</c:if>

<a href="main.html">Main Page - Flight List</a>

<jsp:include page="footer.jsp"></jsp:include>
		
</body></html>